package com.example.demo;

import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ThreadPoolExecutor;

@SpringBootApplication
@EnableAspectJAutoProxy
public class DemoApplication {

    public static void main(String[] args) {

//        HttpClients.custom().setRetryHandler()

//        SpringApplication.run(DemoApplication.class, args);

//        SpringApplication springApplication = new SpringApplication(DemoApplication.class);
//        Set<String> sources = springApplication.getSources();
//        sources.add("bean.xml");
//        springApplication.setSources(sources);
//        ConfigurableApplicationContext run1 = springApplication.run(args);
//        User user = run1.getBean("user", User.class);

//        ClassPathXmlApplicationContext classPathXmlApplicationContext = new ClassPathXmlApplicationContext("bean.xml");
//        AnnotationConfigServletWebApplicationContext annotationConfigServletWebApplicationContext = new AnnotationConfigServletWebApplicationContext();
//        annotationConfigServletWebApplicationContext.scan("com.example.demo.demos.web");
//        annotationConfigServletWebApplicationContext.refresh();
//        Object basicController2 = annotationConfigServletWebApplicationContext.getBean("basicController");
//        AnnotationConfigApplicationContext annotationConfigApplicationContext = new AnnotationConfigApplicationContext();
//        annotationConfigApplicationContext.scan("com.example.demo.demos.web");
//        annotationConfigApplicationContext.refresh();
//        Object basicController = classPathXmlApplicationContext.getBean("basicController");
//        Object basicController1 = annotationConfigApplicationContext.getBean("basicController");

//        ConcurrentHashMap<String, String> ccm = new ConcurrentHashMap<>();
//        ccm.computeIfAbsent("a",(s -> "你好"));
//        String a = ccm.get("a");
//        System.out.println(a);

    }

}
